#version 300 es

precision mediump float;
in vec2 yuvTexPos;
out vec4 fragmentColor;
uniform sampler2D uniTexY;
uniform sampler2D uniTexU;
uniform sampler2D uniTexV;

void main() {
    vec3 yuv;
    yuv.x=texture(uniTexY, yuvTexPos).r;
    yuv.y=texture(uniTexU, yuvTexPos).r-0.5;
    yuv.z=texture(uniTexV, yuvTexPos).r-0.5;
    vec3 rgb=mat3(
    1.0f, 1.0f, 1.0f,
    0.0f, -0.18732f, 1.8556f,
    1.57481f, -0.46813f, 0.0f
    )*yuv;
    fragmentColor=vec4(rgb, 1);
}
